import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.Insets;
import java.awt.Point;
import java.awt.Toolkit;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;

import java.awt.GridLayout;

import javax.swing.JButton;
import javax.swing.ImageIcon;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;


public class MenuNew extends JFrame {

	private JPanel contentPane;

	/**
	 * Launch the application.
	 *//*
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					MenuNew frame = new MenuNew();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}
*/
	
	/**
	 * Create the frame.
	 */
	
	public static String tytulOkna = "Menu";
	public static Dimension rozmiarOkna = new Dimension(300, 300);
	Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
	
	Point middle = new Point(screenSize.width / 2, screenSize.height / 2);
	Point newLocation = new Point(middle.x - rozmiarOkna.width/2, 
	                              middle.y - rozmiarOkna.width/2 + 80);
	
	public MenuNew() {
		setTitle(tytulOkna);
		setSize(rozmiarOkna);
		setUndecorated(true);
		setResizable(false);
		setLocation(newLocation);
		//setLocationRelativeTo(null);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(0, 0, 0, 0));
		setContentPane(contentPane);
		contentPane.setLayout(new GridLayout(3, 1, 0, 0));
		
		JButton btnNowa = new JButton("");
		btnNowa.setMargin(new Insets(0, 0, 0, 0));
		btnNowa.setBorder(null);		
		btnNowa.setIcon(new ImageIcon("res/btnNowa.png"));
		btnNowa.setDisabledIcon(new ImageIcon("res/btnNowa.png"));
		btnNowa.setPressedIcon(new ImageIcon("res/btnNowa3.png"));
		btnNowa.setSelectedIcon(new ImageIcon("res/btnNowa.png"));
		btnNowa.setDisabledSelectedIcon(new ImageIcon("res/btnNowa.png"));		   
		btnNowa.setRolloverEnabled(true); // turn on before rollovers work
		btnNowa.setRolloverIcon(new ImageIcon("res/btnNowa2.png"));
		btnNowa.setRolloverSelectedIcon(new ImageIcon("res/btnNowa2.png"));				
		contentPane.add(btnNowa);
		
		JButton btnStats = new JButton("");
		btnStats.setMargin(new Insets(0, 0, 0, 0));
		btnStats.setBorder(null);		
		btnStats.setIcon(new ImageIcon("res/btnStats.png"));
		btnStats.setDisabledIcon(new ImageIcon("res/btnStats.png"));
		btnStats.setPressedIcon(new ImageIcon("res/btnStats3.png"));
		btnStats.setSelectedIcon(new ImageIcon("res/btnStats.png"));
		btnStats.setDisabledSelectedIcon(new ImageIcon("res/btnStats.png"));		   
		btnStats.setRolloverEnabled(true); // turn on before rollovers work
		btnStats.setRolloverIcon(new ImageIcon("res/btnStats2.png"));
		btnStats.setRolloverSelectedIcon(new ImageIcon("res/btnStats2.png"));				
		contentPane.add(btnStats);
		
		JButton btnExit = new JButton("");
		btnExit.setMargin(new Insets(0, 0, 0, 0));
		btnExit.setBorder(null);		
		btnExit.setIcon(new ImageIcon("res/btnExit.png"));
		btnExit.setDisabledIcon(new ImageIcon("res/btnExit.png"));
		btnExit.setPressedIcon(new ImageIcon("res/btnExit3.png"));
		btnExit.setSelectedIcon(new ImageIcon("res/btnExit.png"));
		btnExit.setDisabledSelectedIcon(new ImageIcon("res/btnExit.png"));		   
		btnExit.setRolloverEnabled(true); // turn on before rollovers work
		btnExit.setRolloverIcon(new ImageIcon("res/btnExit2.png"));
		btnExit.setRolloverSelectedIcon(new ImageIcon("res/btnExit2.png"));		
		contentPane.add(btnExit);
		
		btnNowa.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				NickDialog nickWindow = new NickDialog();
            	dispose();
			}
		});		
		btnStats.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
							
				Statystyki statsWindow = new Statystyki();
            		
			}
		});		
		btnExit.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				System.exit(0);
			}
		});
		setVisible(true);
		
	}

}
